package com.resurvolution.kingcloudmusicspringboot.product.controller;

import com.resurvolution.kingcloudmusicspringboot.common.utils.UnifyResult;
import com.resurvolution.kingcloudmusicspringboot.product.service.ArtistService;
import com.resurvolution.kingcloudmusicspringboot.product.vo.ArtistVO;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/artist")
public class ArtistController {
    @Resource
    private ArtistService artistService;

    @GetMapping()
    public UnifyResult<List<ArtistVO>> artists(@RequestParam(required = false) String input) {
        return UnifyResult.success(artistService.getArtists(input));
    }
}
